import 'package:love_newf/generated/json/base/json_convert_content.dart';
import 'package:love_newf/app/com/model/room_info_model.dart';
import 'package:love_newf/app/com/model/room_data_model.dart';


RoomInfoModel $RoomInfoModelFromJson(Map<String, dynamic> json) {
  final RoomInfoModel roomInfoModel = RoomInfoModel();
  final int? id = jsonConvert.convert<int>(json['id']);
  if (id != null) {
    roomInfoModel.id = id;
  }
  final int? userId = jsonConvert.convert<int>(json['userId']);
  if (userId != null) {
    roomInfoModel.userId = userId;
  }
  final int? selfUserId = jsonConvert.convert<int>(json['selfUserId']);
  if (selfUserId != null) {
    roomInfoModel.selfUserId = selfUserId;
  }
  final String? name = jsonConvert.convert<String>(json['name']);
  if (name != null) {
    roomInfoModel.name = name;
  }
  final String? firstMsg = jsonConvert.convert<String>(json['firstMsg']);
  if (firstMsg != null) {
    roomInfoModel.firstMsg = firstMsg;
  }
  final int? roomType = jsonConvert.convert<int>(json['roomType']);
  if (roomType != null) {
    roomInfoModel.roomType = roomType;
  }
  final String? roomCover = jsonConvert.convert<String>(json['roomCover']);
  if (roomCover != null) {
    roomInfoModel.roomCover = roomCover;
  }
  final String? createTime = jsonConvert.convert<String>(json['createTime']);
  if (createTime != null) {
    roomInfoModel.createTime = createTime;
  }
  final String? endTime = jsonConvert.convert<String>(json['endTime']);
  if (endTime != null) {
    roomInfoModel.endTime = endTime;
  }
  final int? accumulatePeople = jsonConvert.convert<int>(
      json['accumulatePeople']);
  if (accumulatePeople != null) {
    roomInfoModel.accumulatePeople = accumulatePeople;
  }
  final int? receiveTokens = jsonConvert.convert<int>(json['receiveTokens']);
  if (receiveTokens != null) {
    roomInfoModel.receiveTokens = receiveTokens;
  }
  final int? autoShangMai = jsonConvert.convert<int>(json['autoShangMai']);
  if (autoShangMai != null) {
    roomInfoModel.autoShangMai = autoShangMai;
  }
  final int? hideRoom = jsonConvert.convert<int>(json['hideRoom']);
  if (hideRoom != null) {
    roomInfoModel.hideRoom = hideRoom;
  }
  final int? coverUserId = jsonConvert.convert<int>(json['coverUserId']);
  if (coverUserId != null) {
    roomInfoModel.coverUserId = coverUserId;
  }
  final int? onlineCount = jsonConvert.convert<int>(json['onlineCount']);
  if (onlineCount != null) {
    roomInfoModel.onlineCount = onlineCount;
  }
  final int? deleteFlag = jsonConvert.convert<int>(json['deleteFlag']);
  if (deleteFlag != null) {
    roomInfoModel.deleteFlag = deleteFlag;
  }
  final int? musicPropId = jsonConvert.convert<int>(json['musicPropId']);
  if (musicPropId != null) {
    roomInfoModel.musicPropId = musicPropId;
  }
  final int? musicJumpTokens = jsonConvert.convert<int>(
      json['musicJumpTokens']);
  if (musicJumpTokens != null) {
    roomInfoModel.musicJumpTokens = musicJumpTokens;
  }
  final int? minutes = jsonConvert.convert<int>(json['minutes']);
  if (minutes != null) {
    roomInfoModel.minutes = minutes;
  }
  final int? changed = jsonConvert.convert<int>(json['changed']);
  if (changed != null) {
    roomInfoModel.changed = changed;
  }
  final RoomInfoUserRoomVO? userRoomVO = jsonConvert.convert<
      RoomInfoUserRoomVO>(json['userRoomVO']);
  if (userRoomVO != null) {
    roomInfoModel.userRoomVO = userRoomVO;
  }
  final List<RoomDataRoomMais>? roomMais = (json['roomMais'] as List<dynamic>?)
      ?.map(
          (e) => jsonConvert.convert<RoomDataRoomMais>(e) as RoomDataRoomMais)
      .toList();
  if (roomMais != null) {
    roomInfoModel.roomMais = roomMais;
  }
  final int? addHostUserFans = jsonConvert.convert<int>(
      json['addHostUserFans']);
  if (addHostUserFans != null) {
    roomInfoModel.addHostUserFans = addHostUserFans;
  }
  final int? tokens = jsonConvert.convert<int>(json['tokens']);
  if (tokens != null) {
    roomInfoModel.tokens = tokens;
  }
  final int? toppingMaiIndex = jsonConvert.convert<int>(
      json['toppingMaiIndex']);
  if (toppingMaiIndex != null) {
    roomInfoModel.toppingMaiIndex = toppingMaiIndex;
  }
  final int? autoClose = jsonConvert.convert<int>(json['autoClose']);
  if (autoClose != null) {
    roomInfoModel.autoClose = autoClose;
  }
  final int? autoCloseInterval = jsonConvert.convert<int>(
      json['autoCloseInterval']);
  if (autoCloseInterval != null) {
    roomInfoModel.autoCloseInterval = autoCloseInterval;
  }
  return roomInfoModel;
}

Map<String, dynamic> $RoomInfoModelToJson(RoomInfoModel entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['userId'] = entity.userId;
  data['selfUserId'] = entity.selfUserId;
  data['name'] = entity.name;
  data['firstMsg'] = entity.firstMsg;
  data['roomType'] = entity.roomType;
  data['roomCover'] = entity.roomCover;
  data['createTime'] = entity.createTime;
  data['endTime'] = entity.endTime;
  data['accumulatePeople'] = entity.accumulatePeople;
  data['receiveTokens'] = entity.receiveTokens;
  data['autoShangMai'] = entity.autoShangMai;
  data['hideRoom'] = entity.hideRoom;
  data['coverUserId'] = entity.coverUserId;
  data['onlineCount'] = entity.onlineCount;
  data['deleteFlag'] = entity.deleteFlag;
  data['musicPropId'] = entity.musicPropId;
  data['musicJumpTokens'] = entity.musicJumpTokens;
  data['minutes'] = entity.minutes;
  data['changed'] = entity.changed;
  data['userRoomVO'] = entity.userRoomVO?.toJson();
  data['roomMais'] = entity.roomMais.map((v) => v.toJson()).toList();
  data['addHostUserFans'] = entity.addHostUserFans;
  data['tokens'] = entity.tokens;
  data['toppingMaiIndex'] = entity.toppingMaiIndex;
  data['autoClose'] = entity.autoClose;
  data['autoCloseInterval'] = entity.autoCloseInterval;
  return data;
}

extension RoomInfoModelExtension on RoomInfoModel {
  RoomInfoModel copyWith({
    int? id,
    int? userId,
    int? selfUserId,
    String? name,
    String? firstMsg,
    int? roomType,
    String? roomCover,
    String? createTime,
    String? endTime,
    int? accumulatePeople,
    int? receiveTokens,
    int? autoShangMai,
    int? hideRoom,
    int? coverUserId,
    int? onlineCount,
    int? deleteFlag,
    int? musicPropId,
    int? musicJumpTokens,
    int? minutes,
    int? changed,
    RoomInfoUserRoomVO? userRoomVO,
    List<RoomDataRoomMais>? roomMais,
    int? addHostUserFans,
    int? tokens,
    int? toppingMaiIndex,
    int? autoClose,
    int? autoCloseInterval,
  }) {
    return RoomInfoModel()
      ..id = id ?? this.id
      ..userId = userId ?? this.userId
      ..selfUserId = selfUserId ?? this.selfUserId
      ..name = name ?? this.name
      ..firstMsg = firstMsg ?? this.firstMsg
      ..roomType = roomType ?? this.roomType
      ..roomCover = roomCover ?? this.roomCover
      ..createTime = createTime ?? this.createTime
      ..endTime = endTime ?? this.endTime
      ..accumulatePeople = accumulatePeople ?? this.accumulatePeople
      ..receiveTokens = receiveTokens ?? this.receiveTokens
      ..autoShangMai = autoShangMai ?? this.autoShangMai
      ..hideRoom = hideRoom ?? this.hideRoom
      ..coverUserId = coverUserId ?? this.coverUserId
      ..onlineCount = onlineCount ?? this.onlineCount
      ..deleteFlag = deleteFlag ?? this.deleteFlag
      ..musicPropId = musicPropId ?? this.musicPropId
      ..musicJumpTokens = musicJumpTokens ?? this.musicJumpTokens
      ..minutes = minutes ?? this.minutes
      ..changed = changed ?? this.changed
      ..userRoomVO = userRoomVO ?? this.userRoomVO
      ..roomMais = roomMais ?? this.roomMais
      ..addHostUserFans = addHostUserFans ?? this.addHostUserFans
      ..tokens = tokens ?? this.tokens
      ..toppingMaiIndex = toppingMaiIndex ?? this.toppingMaiIndex
      ..autoClose = autoClose ?? this.autoClose
      ..autoCloseInterval = autoCloseInterval ?? this.autoCloseInterval;
  }
}

RoomInfoUserRoomVO $RoomInfoUserRoomVOFromJson(Map<String, dynamic> json) {
  final RoomInfoUserRoomVO roomInfoUserRoomVO = RoomInfoUserRoomVO();
  final int? userId = jsonConvert.convert<int>(json['userId']);
  if (userId != null) {
    roomInfoUserRoomVO.userId = userId;
  }
  final String? userCode = jsonConvert.convert<String>(json['userCode']);
  if (userCode != null) {
    roomInfoUserRoomVO.userCode = userCode;
  }
  final String? avatar = jsonConvert.convert<String>(json['avatar']);
  if (avatar != null) {
    roomInfoUserRoomVO.avatar = avatar;
  }
  final String? nick = jsonConvert.convert<String>(json['nick']);
  if (nick != null) {
    roomInfoUserRoomVO.nick = nick;
  }
  final int? sex = jsonConvert.convert<int>(json['sex']);
  if (sex != null) {
    roomInfoUserRoomVO.sex = sex;
  }
  final int? age = jsonConvert.convert<int>(json['age']);
  if (age != null) {
    roomInfoUserRoomVO.age = age;
  }
  final String? avatarFrameUrl = jsonConvert.convert<String>(
      json['avatarFrameUrl']);
  if (avatarFrameUrl != null) {
    roomInfoUserRoomVO.avatarFrameUrl = avatarFrameUrl;
  }
  final int? vipGrade = jsonConvert.convert<int>(json['vipGrade']);
  if (vipGrade != null) {
    roomInfoUserRoomVO.vipGrade = vipGrade;
  }
  final List<
      RoomInfoUserRoomVOUserLabels>? userLabels = (json['userLabels'] as List<
      dynamic>?)?.map(
          (e) =>
      jsonConvert.convert<RoomInfoUserRoomVOUserLabels>(
          e) as RoomInfoUserRoomVOUserLabels).toList();
  if (userLabels != null) {
    roomInfoUserRoomVO.userLabels = userLabels;
  }
  final int? prohibition = jsonConvert.convert<int>(json['prohibition']);
  if (prohibition != null) {
    roomInfoUserRoomVO.prohibition = prohibition;
  }
  final String? beautifulCodeUrl = jsonConvert.convert<String>(
      json['beautifulCodeUrl']);
  if (beautifulCodeUrl != null) {
    roomInfoUserRoomVO.beautifulCodeUrl = beautifulCodeUrl;
  }
  final String? chatFrameUrl = jsonConvert.convert<String>(
      json['chatFrameUrl']);
  if (chatFrameUrl != null) {
    roomInfoUserRoomVO.chatFrameUrl = chatFrameUrl;
  }
  return roomInfoUserRoomVO;
}

Map<String, dynamic> $RoomInfoUserRoomVOToJson(RoomInfoUserRoomVO entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['userId'] = entity.userId;
  data['userCode'] = entity.userCode;
  data['avatar'] = entity.avatar;
  data['nick'] = entity.nick;
  data['sex'] = entity.sex;
  data['age'] = entity.age;
  data['avatarFrameUrl'] = entity.avatarFrameUrl;
  data['vipGrade'] = entity.vipGrade;
  data['userLabels'] = entity.userLabels.map((v) => v.toJson()).toList();
  data['prohibition'] = entity.prohibition;
  data['beautifulCodeUrl'] = entity.beautifulCodeUrl;
  data['chatFrameUrl'] = entity.chatFrameUrl;
  return data;
}

extension RoomInfoUserRoomVOExtension on RoomInfoUserRoomVO {
  RoomInfoUserRoomVO copyWith({
    int? userId,
    String? userCode,
    String? avatar,
    String? nick,
    int? sex,
    int? age,
    String? avatarFrameUrl,
    int? vipGrade,
    List<RoomInfoUserRoomVOUserLabels>? userLabels,
    int? prohibition,
    String? beautifulCodeUrl,
    String? chatFrameUrl,
  }) {
    return RoomInfoUserRoomVO()
      ..userId = userId ?? this.userId
      ..userCode = userCode ?? this.userCode
      ..avatar = avatar ?? this.avatar
      ..nick = nick ?? this.nick
      ..sex = sex ?? this.sex
      ..age = age ?? this.age
      ..avatarFrameUrl = avatarFrameUrl ?? this.avatarFrameUrl
      ..vipGrade = vipGrade ?? this.vipGrade
      ..userLabels = userLabels ?? this.userLabels
      ..prohibition = prohibition ?? this.prohibition
      ..beautifulCodeUrl = beautifulCodeUrl ?? this.beautifulCodeUrl
      ..chatFrameUrl = chatFrameUrl ?? this.chatFrameUrl;
  }
}

RoomInfoUserRoomVOUserLabels $RoomInfoUserRoomVOUserLabelsFromJson(
    Map<String, dynamic> json) {
  final RoomInfoUserRoomVOUserLabels roomInfoUserRoomVOUserLabels = RoomInfoUserRoomVOUserLabels();
  final int? anchorUserId = jsonConvert.convert<int>(json['anchorUserId']);
  if (anchorUserId != null) {
    roomInfoUserRoomVOUserLabels.anchorUserId = anchorUserId;
  }
  final String? labelName = jsonConvert.convert<String>(json['labelName']);
  if (labelName != null) {
    roomInfoUserRoomVOUserLabels.labelName = labelName;
  }
  final int? labelType = jsonConvert.convert<int>(json['labelType']);
  if (labelType != null) {
    roomInfoUserRoomVOUserLabels.labelType = labelType;
  }
  final String? url = jsonConvert.convert<String>(json['url']);
  if (url != null) {
    roomInfoUserRoomVOUserLabels.url = url;
  }
  return roomInfoUserRoomVOUserLabels;
}

Map<String, dynamic> $RoomInfoUserRoomVOUserLabelsToJson(
    RoomInfoUserRoomVOUserLabels entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['anchorUserId'] = entity.anchorUserId;
  data['labelName'] = entity.labelName;
  data['labelType'] = entity.labelType;
  data['url'] = entity.url;
  return data;
}

extension RoomInfoUserRoomVOUserLabelsExtension on RoomInfoUserRoomVOUserLabels {
  RoomInfoUserRoomVOUserLabels copyWith({
    int? anchorUserId,
    String? labelName,
    int? labelType,
    String? url,
  }) {
    return RoomInfoUserRoomVOUserLabels()
      ..anchorUserId = anchorUserId ?? this.anchorUserId
      ..labelName = labelName ?? this.labelName
      ..labelType = labelType ?? this.labelType
      ..url = url ?? this.url;
  }
}

RoomInfoRoomMaisRoomAnchorStickersList $RoomInfoRoomMaisRoomAnchorStickersListFromJson(
    Map<String, dynamic> json) {
  final RoomInfoRoomMaisRoomAnchorStickersList roomInfoRoomMaisRoomAnchorStickersList = RoomInfoRoomMaisRoomAnchorStickersList();
  final int? propId = jsonConvert.convert<int>(json['propId']);
  if (propId != null) {
    roomInfoRoomMaisRoomAnchorStickersList.propId = propId;
  }
  final int? count = jsonConvert.convert<int>(json['count']);
  if (count != null) {
    roomInfoRoomMaisRoomAnchorStickersList.count = count;
  }
  final String? lastTime = jsonConvert.convert<String>(json['lastTime']);
  if (lastTime != null) {
    roomInfoRoomMaisRoomAnchorStickersList.lastTime = lastTime;
  }
  return roomInfoRoomMaisRoomAnchorStickersList;
}

Map<String, dynamic> $RoomInfoRoomMaisRoomAnchorStickersListToJson(
    RoomInfoRoomMaisRoomAnchorStickersList entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['propId'] = entity.propId;
  data['count'] = entity.count;
  data['lastTime'] = entity.lastTime;
  return data;
}

extension RoomInfoRoomMaisRoomAnchorStickersListExtension on RoomInfoRoomMaisRoomAnchorStickersList {
  RoomInfoRoomMaisRoomAnchorStickersList copyWith({
    int? propId,
    int? count,
    String? lastTime,
  }) {
    return RoomInfoRoomMaisRoomAnchorStickersList()
      ..propId = propId ?? this.propId
      ..count = count ?? this.count
      ..lastTime = lastTime ?? this.lastTime;
  }
}

RoomInfoRoomMaisMusicVO $RoomInfoRoomMaisMusicVOFromJson(
    Map<String, dynamic> json) {
  final RoomInfoRoomMaisMusicVO roomInfoRoomMaisMusicVO = RoomInfoRoomMaisMusicVO();
  final int? userId = jsonConvert.convert<int>(json['userId']);
  if (userId != null) {
    roomInfoRoomMaisMusicVO.userId = userId;
  }
  final String? nick = jsonConvert.convert<String>(json['nick']);
  if (nick != null) {
    roomInfoRoomMaisMusicVO.nick = nick;
  }
  final String? avatar = jsonConvert.convert<String>(json['avatar']);
  if (avatar != null) {
    roomInfoRoomMaisMusicVO.avatar = avatar;
  }
  final int? pointUserId = jsonConvert.convert<int>(json['pointUserId']);
  if (pointUserId != null) {
    roomInfoRoomMaisMusicVO.pointUserId = pointUserId;
  }
  final String? pointNick = jsonConvert.convert<String>(json['pointNick']);
  if (pointNick != null) {
    roomInfoRoomMaisMusicVO.pointNick = pointNick;
  }
  final String? pointAvatar = jsonConvert.convert<String>(json['pointAvatar']);
  if (pointAvatar != null) {
    roomInfoRoomMaisMusicVO.pointAvatar = pointAvatar;
  }
  final String? musicSerialNumber = jsonConvert.convert<String>(
      json['musicSerialNumber']);
  if (musicSerialNumber != null) {
    roomInfoRoomMaisMusicVO.musicSerialNumber = musicSerialNumber;
  }
  final int? musicStatus = jsonConvert.convert<int>(json['musicStatus']);
  if (musicStatus != null) {
    roomInfoRoomMaisMusicVO.musicStatus = musicStatus;
  }
  final String? musicName = jsonConvert.convert<String>(json['musicName']);
  if (musicName != null) {
    roomInfoRoomMaisMusicVO.musicName = musicName;
  }
  final String? createTime = jsonConvert.convert<String>(json['createTime']);
  if (createTime != null) {
    roomInfoRoomMaisMusicVO.createTime = createTime;
  }
  return roomInfoRoomMaisMusicVO;
}

Map<String, dynamic> $RoomInfoRoomMaisMusicVOToJson(
    RoomInfoRoomMaisMusicVO entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['userId'] = entity.userId;
  data['nick'] = entity.nick;
  data['avatar'] = entity.avatar;
  data['pointUserId'] = entity.pointUserId;
  data['pointNick'] = entity.pointNick;
  data['pointAvatar'] = entity.pointAvatar;
  data['musicSerialNumber'] = entity.musicSerialNumber;
  data['musicStatus'] = entity.musicStatus;
  data['musicName'] = entity.musicName;
  data['createTime'] = entity.createTime;
  return data;
}

extension RoomInfoRoomMaisMusicVOExtension on RoomInfoRoomMaisMusicVO {
  RoomInfoRoomMaisMusicVO copyWith({
    int? userId,
    String? nick,
    String? avatar,
    int? pointUserId,
    String? pointNick,
    String? pointAvatar,
    String? musicSerialNumber,
    int? musicStatus,
    String? musicName,
    String? createTime,
  }) {
    return RoomInfoRoomMaisMusicVO()
      ..userId = userId ?? this.userId
      ..nick = nick ?? this.nick
      ..avatar = avatar ?? this.avatar
      ..pointUserId = pointUserId ?? this.pointUserId
      ..pointNick = pointNick ?? this.pointNick
      ..pointAvatar = pointAvatar ?? this.pointAvatar
      ..musicSerialNumber = musicSerialNumber ?? this.musicSerialNumber
      ..musicStatus = musicStatus ?? this.musicStatus
      ..musicName = musicName ?? this.musicName
      ..createTime = createTime ?? this.createTime;
  }
}